//
//  DetailViewController.m
//  17-UI-AddressBook
//
//  Created by Snow on 16/8/6.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "DetailViewController.h"
#import "Model.h"
@interface DetailViewController ()
@property (nonatomic, strong) UIImageView *image;
@property (nonatomic, strong) UILabel *labelOfname ;
@property (nonatomic, strong) UILabel *labelOfPhone;
@property (nonatomic, strong) UILabel *labelOfgender;
@property (nonatomic, strong) UILabel *labelOfAge;
@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.image = [[UIImageView alloc] initWithFrame:CGRectMake(100, 50, self.view.frame.size.width - 200, self.view.frame.size.width - 200)];
    self.labelOfname = [[UILabel alloc] initWithFrame:CGRectMake(100, self.view.frame.size.width - 200 + 50, self.view.frame.size.width - 200, 30)];
    self.labelOfPhone = [[UILabel alloc] initWithFrame:CGRectMake(100, self.view.frame.size.width - 200 + 80, self.view.frame.size.width - 200, 30)];
    self.labelOfgender = [[UILabel alloc] initWithFrame:CGRectMake(100, self.view.frame.size.width - 200 + 110, self.view.frame.size.width - 200, 30)];
    self.labelOfAge = [[UILabel alloc] initWithFrame:CGRectMake(100, self.view.frame.size.width - 200 + 140, self.view.frame.size.width - 200, 30)];
    [self.view addSubview:self.image];
    [self.view addSubview:self.labelOfname];
    [self.view addSubview:self.labelOfPhone];
    [self.view addSubview:self.labelOfAge];
    [self.view addSubview:self.labelOfgender];
    _image.image = [UIImage imageNamed:@"u=1563663233,4023384541&fm=23&gp=0"];
    _labelOfname.text = _model.name;
    _labelOfname.textAlignment = 1;
    _labelOfPhone.text = _model.phoneNumber;
    _labelOfPhone.textAlignment = 1;
    _labelOfgender.text = _model.gender;
    _labelOfgender.textAlignment = 1;
    _labelOfAge.text = [_model.age stringValue];
    _labelOfAge.textAlignment = 1;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
